package com.wsz.ucenter.scheduling;

import com.wsz.ucenter.controller.UcenterController;
import com.wsz.utils.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;

@Component
public class UcenterScheduling {
    @Autowired
    private UcenterController ucenterController;

    @Scheduled(cron = "0 0 1 * * ? ")
    public void task(){
        ucenterController.getUcenterCount(DateUtil.formatDate(DateUtil.addDays(new Date(),-1)));
    }

}
